/*
 * FileName: DailyTypeDef.java
 *
 */
package com.mrc.ak.daily.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.StringUtils;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author Mrc
 * @version 4.1

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2016-12-22 下午3:57:15          Mrc        4.1         To create
 * </p>
 *
 * @since 
 * @see     
 */
@Entity
@Table(name = "ak_daily_type_def")
public class DailyTypeDef implements Serializable {
    private static final long serialVersionUID = 4051517919118555399L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id_")
    private Long id;
    @Column(name = "column_key")
    private String columnKey;// 列英文
    @Column(name = "column_value")
    private String columnValue;// 列中文
    @Column(name = "status")
    private Integer status;// 状态 1--正常
    @Column(name = "create_date")
    private Date createDate;// 创建人
    @Column(name = "create_code")
    private String createCode;// 创建时间

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the columnKey
     */
    public List<String> getColumnKey() {
        List<String> list = new ArrayList<String>();
        if (StringUtils.isEmpty(columnKey))
            return list;
        Collections.addAll(list, columnKey.split(","));
        return list;
    }

    /**
     * @param columnKey the columnKey to set
     */
    public void setColumnKey(List<String> columnKey) {
        String[] strs = columnKey.toArray(new String[columnKey.size()]);
        this.columnKey = StringUtils.join(strs, ",");
    }

    /**
     * @return the columnValue
     */
    public List<String> getColumnValue() {
        List<String> list = new ArrayList<String>();
        if (StringUtils.isEmpty(columnValue))
            return list;
        Collections.addAll(list, columnValue.split(","));
        return list;
    }

    /**
     * @param columnValue the columnValue to set
     */
    public void setColumnValue(List<String> columnValue) {
        String[] strs = columnValue.toArray(new String[columnValue.size()]);
        this.columnValue = StringUtils.join(strs, ",");
    }

    /**
     * @return the status
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * @return the serialversionuid
     */
    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    /**
     * @return the createDate
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * @param createDate the createDate to set
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * @return the createCode
     */
    public String getCreateCode() {
        return createCode;
    }

    /**
     * @param createCode the createCode to set
     */
    public void setCreateCode(String createCode) {
        this.createCode = createCode;
    }

}
